﻿using System;
using System.Collections.Generic;
using System.Text;

namespace WebSEClassLibrary
{
    /// <summary>
    /// 角色:指经理,员工等,不包括用户.
    /// </summary>
    public class Person
    {
        /// <summary>
        /// 该人物的ID
        /// </summary>
        private int personId;

        public int PersonId
        {
            get { return personId; }
            set { personId = value; }
        }
        /// <summary>
        /// 该Person的名称
        /// </summary>
        private string name;

        public string Name
        {
            get { return name; }
            set { name = value; }
        }
        /// <summary>
        /// 头像,这里的头像只需要保存图片的路径
        /// </summary>
        private string headPicture;

        public string HeadPicture
        {
            get { return headPicture; }
            set { headPicture = value; }
        }
        /// <summary>
        /// 全身像
        /// </summary>
        private Picture wholePicture;

        public Picture WholePicture
        {
            get { return wholePicture; }
            set { wholePicture = value; }
        }
        /// <summary>
        /// 当前的对话
        /// </summary>
        private Dialog currentDialog;

        public Dialog CurrentDialog
        {
            get { return currentDialog; }
            set { currentDialog = value; }
        }
        /// <summary>
        /// 下一个状态
        /// </summary>
        private StateEnum nextState;

        public StateEnum NextState
        {
            get { return nextState; }
            set { nextState = value; }
        }
        #region 公用方法
        public Person(int pId)
        {
            //从XML中读取关于该personID的有关信息,包括headPicture,name,nextState,personID,
            //而currentDialog和wholePicture则需要根据相应的dialogId和pictureID调用相应的构造函数实例化
        }
        /// <summary>
        /// 获取与该人物的下一个对话
        /// </summary>
        /// <param name="choiceID">选项ID</param>
        /// <returns>若该对话已经是最后一个对话则返回true,否则false</returns>
        public bool getNextDialog(int choiceID)
        {
            if (this.currentDialog.IsTerminal == true)
                return true;
            this.currentDialog = this.currentDialog.getNextDialog(choiceID);
            return false;
        }
        #endregion
    }
}
